

#include "xmodule_config.h"

#if MODULE_HEARTRATE_ENABLE

#include <string.h>

const em_heartrate_instance_t* HEARTRATE_SENSOR_LIST[] = 
{
#if HX3300_ENABLE
    &HR_HX3300,
#endif 

#if SC7R31_ENABLE
    &HR_SC7R31,
#endif 

#if VC32S_ENABLE
    &HR_VC32S,
#endif 

#if PAH8009_ENABLE
    &HR_PAH8009,
#endif 
    
};


const em_heartrate_instance_t* em_heartrate_list_mouting( em_heartrate_desc_t* p_desc )
{
    em_heartrate_desc_t desc;
    desc.chip_id = 0;
    for(int i = 0; i < sizeof( HEARTRATE_SENSOR_LIST)/sizeof(HEARTRATE_SENSOR_LIST[0]); i ++ )
    {
        if( HEARTRATE_SENSOR_LIST[i]->mounting( &desc ) )
        {
            if( p_desc != NULL )
            {
                *p_desc = desc;
            }
            return HEARTRATE_SENSOR_LIST[i];
        }
    }
    return NULL;
}

#endif 
